package com.openbravo.pos.ticket;

import com.openbravo.format.Formats;
import com.openbravo.pos.util.ThumbNailBuilder;
import java.awt.Component;
import java.awt.Image;
import javax.swing.DefaultListCellRenderer;
import javax.swing.ImageIcon;
import javax.swing.JList;

public class ProductRenderer extends DefaultListCellRenderer
{
  ThumbNailBuilder tnbprod = new ThumbNailBuilder(64, 32, "com/openbravo/images/package.png");

  public Component getListCellRendererComponent(JList paramJList, Object paramObject, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    super.getListCellRendererComponent(paramJList, null, paramInt, paramBoolean1, paramBoolean2);
    ProductInfoExt localProductInfoExt = (ProductInfoExt)paramObject;
    if (localProductInfoExt != null)
    {
      setText("<html>" + localProductInfoExt.getReference() + " - " + localProductInfoExt.getName() + "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + Formats.CURRENCY.formatValue(new Double(localProductInfoExt.getPriceSell())));
      Image localImage = this.tnbprod.getThumbNail(localProductInfoExt.getImage());
      setIcon(localImage == null ? null : new ImageIcon(localImage));
    }
    return this;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.ticket.ProductRenderer
 * JD-Core Version:    0.6.0
 */